package com.stefanie.study.sfp;

/**
 * @author: stefanie-zy
 * @time: 2024/6/27-14:31
 * @description: 抽象工厂
 */
public class Factory {

    // 工厂方法
    public static Product getProduct(String str) {
        Product product = null;

        if ("A".equals(str)) {
            product = new ProductA();
        } else if ("B".equals(str)) {
            product = new ProductB();
        }

        return product;
    }
}
